USE [Clinic]
GO
/****** Object:  StoredProcedure [dbo].[up_UrinaUpdate]    Script Date: 01/15/2008 22:01:32 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_UrinaUpdate]
		  @UrinaID int
		, @Date smalldatetime
		, @Color nvarchar(50)
		, @ReactionPh nvarchar(50)
		, @Vitellus nvarchar(50)
		, @Sugar nvarchar(50)
		, @Aceton nvarchar(50)
		, @Urebilinogen nvarchar(50)
		, @Bilirubin nvarchar(50)
		, @Blood nvarchar(50)
		, @Levkociti nvarchar(50)
		, @Eritrociti nvarchar(50)
		, @Hial nvarchar(50)
		, @UrKalc nvarchar(50)
		, @Option1 nvarchar(50)
		, @Option2 nvarchar(50)
		, @Option3 nvarchar(50)
		, @Option4 nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	UPDATE [Urina]
	SET 
		  [Date] = @Date
		, [Color] = @Color
		, [ReactionPh] = @ReactionPh
		, [Vitellus] = @Vitellus
		, [Sugar] = @Sugar
		, [Aceton] = @Aceton
		, [Urebilinogen] = @Urebilinogen
		, [Bilirubin] = @Bilirubin
		, [Blood] = @Blood
		, [Levkociti] = @Levkociti
		, [Eritrociti] = @Eritrociti
		, [Hial] = @Hial
		, [UrKalc] = @UrKalc
		, [Option1] = @Option1
		, [Option2] = @Option2
		, [Option3] = @Option3
		, [Option4] = @Option4
		, [patientID] = @patientID
	WHERE 
		[UrinaID] = @UrinaID
END

/******    ******/
/****** Object:  StoredProcedure [dbo].[up_UrinaInsert]    Script Date: 01/15/2008 22:01:29 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_UrinaInsert]
		  @UrinaID int
		, @Date smalldatetime
		, @Color nvarchar(50)
		, @ReactionPh nvarchar(50)
		, @Vitellus nvarchar(50)
		, @Sugar nvarchar(50)
		, @Aceton nvarchar(50)
		, @Urebilinogen nvarchar(50)
		, @Bilirubin nvarchar(50)
		, @Blood nvarchar(50)
		, @Levkociti nvarchar(50)
		, @Eritrociti nvarchar(50)
		, @Hial nvarchar(50)
		, @UrKalc nvarchar(50)
		, @Option1 nvarchar(50)
		, @Option2 nvarchar(50)
		, @Option3 nvarchar(50)
		, @Option4 nvarchar(50)
		, @patientID int
AS
BEGIN
	SET NOCOUNT ON;
	INSERT INTO [Urina]
	(
		  [Date]
		, [Color]
		, [ReactionPh]
		, [Vitellus]
		, [Sugar]
		, [Aceton]
		, [Urebilinogen]
		, [Bilirubin]
		, [Blood]
		, [Levkociti]
		, [Eritrociti]
		, [Hial]
		, [UrKalc]
		, [Option1]
		, [Option2]
		, [Option3]
		, [Option4]
		, [patientID]
	) 
	VALUES 
	(
		  @Date
		, @Color 
		, @ReactionPh 
		, @Vitellus 
		, @Sugar 
		, @Aceton
		, @Urebilinogen 
		, @Bilirubin
		, @Blood
		, @Levkociti
		, @Eritrociti
		, @Hial
		, @UrKalc 
		, @Option1
		, @Option2
		, @Option3
		, @Option4
		, @patientID
	)		
END


/****** Object:  StoredProcedure [dbo].[up_UrinaGetAllByPatientID]    Script Date: 01/15/2008 22:01:27 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_UrinaGetAllByPatientID]
	  @PatientID int
	
AS
BEGIN
	SET NOCOUNT ON;
	SELECT *
	FROM [Urina]
	WHERE 
		[PatientID] = @PatientID
END

/****** Object:  StoredProcedure [dbo].[up_UrinaDelete]    Script Date: 01/15/2008 22:01:25 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE PROCEDURE [dbo].[up_UrinaDelete]
	  @UrinaID int
	
AS
BEGIN
	SET NOCOUNT ON;
	DELETE FROM [Urina]
	WHERE [UrinaID] = @UrinaID
END

/******    ******/
SET ANSI_NULLS ON